<template>
  <view class="page" style="padding-bottom: 50upx;">
    <u-cell-group class="u-m-t-20">
      <u-cell-item  title="相机/存储权限设置"   @click="showcity"></u-cell-item>
	   <u-cell-item title="位置权限设置" @click="sixinset" ></u-cell-item>
	  <u-cell-item title="相机权限设置" @click="liulanset" ></u-cell-item>
	   <u-cell-item title="麦克风权限设置" @click="quanxian" ></u-cell-item>
	   <u-cell-item title="其他权限设置" @click="quanxian" ></u-cell-item>
    </u-cell-group>
  </view>
</template>

<script>
export default {
  data() {
    return {
      currentSize: 0, //当前缓存大小
      Server:'',
	  zclist:[],
	  showBox: 0,
	  serviceHotline: '',
    };
  },
  
  computed:{
        getuserInfo(){
          return this.$store.getters.getuserInfo
        }
  },
  onLoad(){
   
		this.getServiceHotline();
	uni.request({
		url: 'https://dsx.cdzer.com/api/Article/get_newlist', //仅为示例，并非真实接口地址。
		method: 'POST',
		header: {
			'content-type': 'application/x-www-form-urlencoded',
		},
		success: (res) => {
			console.log(res,"政策列表")
			this.zclist = res.data.data
		}
	});
	
  },
  onShow() {
    this.getStorageInfoSync();
  },
  methods: {
	  hideMask() {
	  	this.showBox = 0;
	  },
	  dail(tel){
	  	uni.makePhoneCall({
	  				phoneNumber: tel
	  			})
	  
	  },
	  getServiceHotline() {
	  	this.$http.getserviceHotline().then(res => {
	  		if (res.status == 200) {
	  			this.serviceHotline = res.data.serviceHotline;
	  
	  		}
	  	})
	  },
	  showPopUpBox() {
	  	this.showBox = 1;
	  },
    navigateTo(url) {
      this.$navigateTo(url);
    },
    
    // 退出登陆
    logout() {
      $utils.showModal({content:'确认退出账户吗?'}).then(res=>{
        console.log("-> res", res);
        if (res.confirm) {
          uni.onSocketClose(function (res) {
            console.log('WebSocket 已关闭！');
          });
          uni.removeStorageSync('token');
          uni.removeStorageSync('device_token');
		  uni.removeStorageSync('userInfo')
          this.$toast('退出登录成功');
    
          this.$u.route({
            url:"/pagesB/login/login",
            type:"reLaunch"
          })
    
        }
      })
      
    },
    // 获取缓存大小
    getStorageInfoSync() {
      uni.getStorageInfo({
        success: res => {
          this.currentSize = (res.currentSize/1024).toFixed(2);
        }
      });
    },
    goAboutus(id,title){
      // this.$u.route({url:'/pagesB/article/detail',params:{title:'关于我们'}{id:id}})
	  uni.navigateTo({
	  	url:`/pagesB/article/detail?tilte=${title}&id=${id}`
	  })
    },
    // 清除缓存
    clearStorage() {
      $utils.showModal({content:'确定要清除缓存吗?'}).then(res=>{
        if (res.confirm) {
          try {
            uni.clearStorageSync();
            this.currentSize = 0
          } catch (e) {
            // error
          }
        }
      })
    
    }
  }
};
</script>

<style lang="scss" scoped>
	.bot{
		background-color: #fff;
		width: 100%;
		height: 550upx;
		border-top-left-radius: 15px;  
		border-top-right-radius: 15px;
		position: relative;
	}
	.popUpBox {
		position: fixed;
		width: 402upx;
		height: 452upx;
		background: #fff;
		z-index: 999;
		border-radius: 20upx;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	
		.tel {
			text-align: center;
			margin-top: -25upx;
	
			image {
				width: 174upx;
				height: 174upx;
			}
		}
	
		.text {
			line-height: 43upx;
			font-weight: bold;
			text-align: center;
		}
	
		.button {
			width: 247upx;
			height: 66upx;
			border-radius: 45upx;
			position: absolute;
			bottom: 36upx;
			left: 50%;
			transform: translate(-50%, 0)
		}
		.cancel {
			width: 53upx;
			height: 53upx;
			position: absolute;
			left: 50%;
			transform: translate(-50%, 0);
			bottom: -75upx;
		
			image {
				width: 100%;
				height: 100%;
			}
		}
		}
@import "~uview-ui/index.scss";

.logoutBtn{
  padding: 20upx;
  background-color: #fff;
  margin-top: 40upx;
  text-align:center;
  color: #666;
}
.title{
  font-size: 32upx;
  margin-bottom: 10upx;
}
.phone{
  font-size:24upx;
  color:#999;
}
.avatarHead{
  background-color: #fff;
  border-bottom: 1px solid #f5f5f5;
  .right{
    position: absolute;
    right: 30upx;
    top: 50%;
    transform: translateY(-50%);
  }
}
</style>
